package com.ideyatech.allowancereceipts.entity;

import java.math.BigDecimal;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hightides.annotations.Controller;
import org.hightides.annotations.Dao;
import org.hightides.annotations.Page;
import org.hightides.annotations.Service;
import org.hightides.annotations.TextField;
import org.opentides.bean.BaseCriteria;
import org.opentides.bean.BaseSortableEntity;

@Dao
@Page
@Controller
@Service
@Entity
@Table(name = "RECEIPT")
public class Receipt extends BaseSortableEntity implements BaseCriteria {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6414309842727561104L;

	@Basic(optional = false)
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "OWNER_ID")
	private Employee owner;
	
	@Basic(optional = false)
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "ESTABLISHMENT_ID")
	private Establishment establishment;
	
	@Basic(optional = false)
	@Column(name = "GROSS_PURCHASE")
	@TextField(requiredField = true, label = "Gross Purchase", listed = true)
	private BigDecimal grossPurchase;

	public Employee getOwner() {
		return owner;
	}

	public void setOwner(Employee owner) {
		this.owner = owner;
	}

	public Establishment getEstablishment() {
		return establishment;
	}

	public void setEstablishment(Establishment establishment) {
		this.establishment = establishment;
	}

	public BigDecimal getGrossPurchase() {
		return grossPurchase;
	}

	public void setGrossPurchase(BigDecimal grossPurchase) {
		this.grossPurchase = grossPurchase;
	}
	
}
